package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.SaleList;
import com.atguigu.jxc.vo.SaleListAndCustomerReturnList;
import com.atguigu.jxc.vo.SaleListVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface SaleListDao {
    //新增销售单
    void saveSaleList(SaleList saleList);

    //销售单查询（可查询条件：销售单号、客户、付款状态）
    List<SaleList> listSelect(@Param("saleNumber") String saleNumber, @Param("customerId") Integer customerId, @Param("state") Integer state, @Param("sTime") String sTime, @Param("eTime") String eTime);

    //删除销售单
    void deleteSaleList(@Param("saleListId") Integer saleListId);

    //支付结算（修改销售单付款状态） Integer saleListId
    void updateState(SaleList saleList);

    //根据id查询
    SaleList selectById(@Param("saleListId") Integer saleListId);

    //销售统计（可根据 商品类别、商品编码或名称 条件查询）
    List<SaleListAndCustomerReturnList> count(@Param("sTime") String sTime, @Param("eTime") String eTime, @Param("goodsTypeId") Integer goodsTypeId, @Param("codeOrName") String codeOrName);

    //按日统计接口
    SaleListVo getSaleDataByDay(@Param("timeDay") String timeDay);

    //按月统计接口
    SaleListVo getSaleDataByMonth(@Param("timeDay") String timeDay);
}
